﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace Manage_Garage_Car.BusinessLogicLayer
{
    class CheckValidationCarStyle
    {

        #region Fields

        private Regex m_nameEx;

        private bool[] m_checkAll;

        #endregion

        #region Properties

        public bool CheckNameCarStyle(string _nameCarStyle)
        {
            if (_nameCarStyle == null || _nameCarStyle == "")
            {
                m_checkAll[0] = false;
                return false;
            }

            m_checkAll[0] = true;
            return true;
        }

        public bool CheckProductCountry(string _productCountry)
        {
            if (_productCountry == null || _productCountry == "")
            {
                m_checkAll[1] = false;
                return false;
            }

            m_checkAll[1] = true;
            return true;
        }

        public bool CheckNote(string _note)
        {
            if (_note == null || _note == "")
            {
                m_checkAll[2] = true;
                return false;
            }

            m_checkAll[2] = true;
            return true;
        }

        public bool CheckAllCarStyle()
        {
            int i = 0;
            while (i < 3)
            {
                if (m_checkAll[i] == false)
                {
                    return false;
                }
                ++i;
            }

            return true;
        }

        public void SetAllCheckFalse()
        {
            m_checkAll[0] = false;
            m_checkAll[1] = false;
            m_checkAll[2] = false;
        }

        public void SetAllCheckTrue()
        {
            m_checkAll[0] = true;
            m_checkAll[1] = true;
            m_checkAll[2] = true;
        }

        #endregion

        #region Initialization

        public CheckValidationCarStyle()
        {
            m_nameEx = new Regex("");
            m_checkAll = new bool[3] { false, false, false };
        }

        #endregion

    }
}
